import request from '@/common/request.js'

/**
 * @description 获取弱实名认证策略信息
 * @author kaijiewang
 * @date 2023-07-07
 * @param {*} userId
 * @returns
 */
function getWeakVerificationStrategy(userId) {
	return request.request(
		`learn-platform/userVerification/getWeakVerificationStrategy`,
		{ data: {} }
	)
}

/**
 * @description 火山视频弱实名认证接口获取数据上传后台
 * @author kaijiewang
 * @date 2023-07-07
 * @param {*} {
 *              bytedToken,   // 本次认证的火山拍摄sdk提供的token
 *              userId,       // 用户id
 *              weekImagePath // 本次认证的火山拍摄sdk提供的图片路径
 *             }
 * @returns
 */
function weakVerify(referenceImagePath, cameraImagePath) {
	return request.request(`learn-platform/userVerification/weak-verify`, {
		method: 'post',
		data: {
			referenceImagePath,
			cameraImagePath,
		},
	})
}

/**
 * @description
 * @author kaijiewang
 * @date 2023-07-10
 * @param {*} { accessKeyId, secretAccessKey, sessionToken, defaultImagePath }
 * @returns
 */
function volcToken({
	accessKeyId,
	secretAccessKey,
	sessionToken,
	defaultImagePath = '',
}) {
	return request.request(`learn-platform/userVerification/volc-token`, {
		method: 'post',
		data: {
			accessKeyId,
			secretAccessKey,
			sessionToken,
			defaultImagePath,
		},
	})
}

export { getWeakVerificationStrategy, weakVerify, volcToken }
